package com.gpframework.module.common.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gpframework.module.common.domain.CommonResource;
import com.gpframework.module.common.domain.req.CommonResourceReq;
import com.gpframework.module.common.domain.vo.CommonResourceVo;
import com.gpframework.module.module.domain.req.BrandStoreReq;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @ClassName CommonResource
 * @Author gpframework
 * @Date 2022-04-07
 * @Version 1.0.0
 * @Description 资源Mapper接口
 */
public interface CommonResourceMapper extends BaseMapper<CommonResource> {

    /**
     * 列表
     *
     * @param lqw
     * @return
     */
    List<CommonResourceVo> listVo(@Param("ew") QueryWrapper<CommonResource> lqw);

    /**
     * 对象
     *
     * @param id
     * @return
     */
    CommonResourceVo getVo(@Param("id") Long id);

    /**
     * 根据品牌id与门店id删除图片
     *
     * @param delResource
     * @return
     */
    int deleteByBrandIdAndStore(CommonResource delResource);

    /**
     * 根据 业务id 获取资源
     *
     * @param businessId 业务id
     * @return
     */
    List<CommonResourceVo> listByBusinessId(Long businessId);

    /**
     * 获取资源
     *
     * @param req
     * @return
     */
    List<CommonResourceVo> listByReq(CommonResourceReq req);

    /**
     * 删除资源
     *
     * @param resourceReq
     * @return
     */
    int del(CommonResourceReq resourceReq);

    /**
     * 获取员工附件缩略图
     *
     * @param brandStoreReq
     * @return
     */
    Set<String> getEmployeesThumb(BrandStoreReq brandStoreReq);
}
